package top.raoqq.sky.vo;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.time.LocalDate;

/**
 * @author 饶奇奇
 * @date 2023/8/11
 */
@Data
public class UserQueryVO {
    @Size(max = 30, message = "用户名最大不能超过30个字符")
    private String username;
    @Pattern(regexp = "^$|^1[3-9]\\d{9}$", message = "无效电话号码")
    private String phone;
    @Min(value = 0, message = "用户状态只能为0或者1")
    @Max(value = 1, message = "用户状态只能为0或者1")
    private Byte status;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate startTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate endTime;
}
